package com.homework.ch05;



public class Test11_Duration {
    public static void main(String[] args) {
        //借助三参构造器 实例化对象
        Duration d1 = new Duration(1,1,1);
        //获取总秒数
        int totalSeconds = d1.getTotalSeconds();
        System.out.println("1小时1分钟1秒: " + totalSeconds);

        System.out.println("-----------------");

        //借助单参构造器 实例化对象
        Duration d2 = new Duration(3660);
        //获取小时
        int hour = d2.getHour();
        System.out.println("hour = " + hour);

        System.out.println("-----------------");

        //输出对象属性信息及总描述信息
        d2.disp();
    }
}